package org.example.common.support;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;
import freemarker.template.Configuration;
import freemarker.template.Template;
import java.io.IOException;

/**
 * @author weigang
 * @create 2022-10-27 16:24
 */
@Component
public class FreemarkerSupport {
    @Autowired
    @Qualifier("wgFreemarkerConfig")
    private Configuration freemarkerConfig;

    public Template getTemplate(String templateName) throws IOException {
        return freemarkerConfig.getTemplate(templateName);
    }
}
